package com.lagou.consumer;

import com.lagou.service.MonitorService;
import org.apache.dubbo.config.annotation.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @ClassName ServiceConsumer
 * @Description
 * @Author playboy
 * @Date 2021/6/19 1:26 下午
 * @Version 1.0
 **/
@Component
public class ServiceConsumer implements Runnable {
	private static Logger log = LoggerFactory.getLogger(ServiceConsumer.class);

	@Reference
	private MonitorService monitorService;


	@Override
	public void run() {
		Thread threadA = new Thread(new Runnable() {
			@Override
			public void run() {
				String s = monitorService.methodA();
			}
		});
		Thread threadB = new Thread(new Runnable() {
			@Override
			public void run() {
				String s = monitorService.methodB();
			}
		});
		Thread threadC = new Thread(new Runnable() {
			@Override
			public void run() {
				String s = monitorService.methodC();
			}
		});

		threadA.start();
		threadB.start();
		threadC.start();
		try {
			threadA.join();
			threadB.join();
			threadC.join();
		} catch (Exception e) {

		}
	}

}
